package com.ranjiaqi.homework;

import java.util.concurrent.Callable;

/**
 * @ClassName SubRunnable
 * @Description TODO
 * @Author hp
 * @Date 2021/7/1 10:31
 * @Version 1.0
 **/
public class SubRunnable implements Callable<Integer> {
    private int num;

    public SubRunnable(int num) {
        this.num = num;
    }

    @Override
    public Integer call() throws Exception {
        int sum = 0;
        for (int i = 1; i <= num; i++) {
            sum += i;
        }
        return sum;
    }
}
